package com.bailiban.service.impl;

import com.bailiban.entity.HistoryData;
import com.bailiban.repository.HistoryDataRepository;
import com.bailiban.service.HistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhulang
 * @Classname HistoryServiceImpl
 * @Description TODO
 * @Date 2020/2/18 14:19
 */
@Service
public class HistoryServiceImpl implements HistoryService {
    @Autowired
    private HistoryDataRepository historyRepository;

    @Override
    public List<HistoryData> findAllByProvinceId(Integer provinceId) {
        List<HistoryData> historyDataList = historyRepository.findByProvinceCov_ProvinceId(provinceId);
        return historyDataList;
    }

    @Override
    public List<HistoryData> findAllByDate(String date) {
        List<HistoryData> historyDataList = historyRepository.findByDate(date);
        return historyDataList;
    }
}
